package top.hjc.orange.user.domain.api;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.hjc.orange.user.domain.repository.UserRepository;

import java.util.Optional;

/**
 * @author: huangjicheng
 * @date: 2025/10/10
 * @desc：
 */
@RestController
@RequestMapping("/api/v1")
public class UserResource implements UserService{

    private final UserRepository userRepository;

    private UserResource(UserRepository userRepository) {
        this.userRepository = userRepository;
    }
    @Override
    public <T> Optional<T> findById(Long id, Class<T> projectionType) {
        return userRepository.findById(id, projectionType);
    }
}
